Page({
  data: {
    Arr: [
      1,2,3,4,5,6,7,8,9,10
    ],
    indicatorDots: false,
    autoplay: false,
    interval: 5000,
    duration: 1000,
    current:0
  },
  move:function(e){
    let touch = e.detail
    console.log(touch)
    let item = wx.getStorageSync('tc')
    if (!item || touch.current>item){
      this.play()
    }
    wx.setStorageSync('tc', touch.current)
  },
  play: function () {
    const innerAudioContext = wx.createInnerAudioContext()
    innerAudioContext.autoplay = true
    innerAudioContext.src = 'https://zeyu7-bucket.oss-cn-beijing.aliyuncs.com/8819.mp3'
    innerAudioContext.onPlay(() => {
      console.log('开始播放')
    })
    innerAudioContext.onError((res) => {
      console.log(res.errMsg)
      console.log(res.errCode)
    })
  },
  change:function(e){
    let index = e.currentTarget.dataset.index
    this.setData({
      current: index
    })
  }
})